package com.yj.provider.service;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.csp.sentinel.slots.block.flow.FlowException;
import com.yj.provider.exception.BusinessException;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@Service
public class TestService {

    @SentinelResource(value = "test",blockHandler = "exceptionHandler")
    public String test(){
        return "test";
    }

    public String exceptionHandler(BlockException e){

//        return "限流了！！！";
        throw new RuntimeException();
    }

}



